
/*
 * Copyright 2002-2018 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2018原创作者。
 *
 *根据Apache许可证2.0版许可（“许可证”）；
 *除非符合许可证的规定，否则您不得使用此文件。
 *您可以在以下网址获取许可证副本：
 *
 *https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证进行的分发是在“按原样”的基础上进行的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限的特定语言，请参阅许可证和
 *许可证下的限制。
 */

package org.springframework.jmx.export;

import javax.management.ObjectName;

/**
 * Interface that defines the set of MBean export operations that are intended to be
 * accessed by application developers during application runtime.
 *
 * <p>This interface should be used to export application resources to JMX using Spring's
 * management interface generation capabilities and, optionally, it's {@link ObjectName}
 * generation capabilities.
 *
 * @author Rob Harrop
 * @since 2.0
 * @see MBeanExporter
 */
/**
 *定义MBean导出操作集的接口
 *由应用程序开发人员在应用程序运行时访问。
 *
 *<p>此接口应用于使用Spring的将应用程序资源导出到JMX
 *管理接口生成功能，以及可选的｛@link ObjectName｝
 *发电能力。
 *
 *@作者Rob Harrop
 *@自2.0起
 *@参见MBeanExporter
 */
public interface MBeanExportOperations {

	/**
	 * Register the supplied resource with JMX. If the resource is not a valid MBean already,
	 * Spring will generate a management interface for it. The exact interface generated will
	 * depend on the implementation and its configuration. This call also generates an
	 * {@link ObjectName} for the managed resource and returns this to the caller.
	 * @param managedResource the resource to expose via JMX
	 * @return the {@link ObjectName} under which the resource was exposed
	 * @throws MBeanExportException if Spring is unable to generate an {@link ObjectName}
	 * or register the MBean
	 */
	/**
	 *向JMX注册提供的资源。如果该资源已经不是有效的MBean，
	 *Spring将为其生成一个管理接口
	 *取决于实现及其配置。此调用还生成
	 *｛@link ObjectName｝，并将其返回给调用方。
	 *@param managedResource通过JMX公开资源
	 *@返回用于公开资源的｛@link ObjectName｝
	 *如果Spring无法生成｛@link ObjectName｝，则@throws MBeanExportException
	 *或注册MBean
	 */
	ObjectName registerManagedResource(Object managedResource) throws MBeanExportException;

	/**
	 * Register the supplied resource with JMX. If the resource is not a valid MBean already,
	 * Spring will generate a management interface for it. The exact interface generated will
	 * depend on the implementation and its configuration.
	 * @param managedResource the resource to expose via JMX
	 * @param objectName the {@link ObjectName} under which to expose the resource
	 * @throws MBeanExportException if Spring is unable to register the MBean
	 */
	/**
	 *向JMX注册提供的资源。如果该资源已经不是有效的MBean，
	 *Spring将为其生成一个管理接口
	 *取决于实现及其配置。
	 *@param managedResource通过JMX公开资源
	 *@param objectName用于公开资源的｛@link objectName｝
	 *如果Spring无法注册MBean，则@throws MBeanExportException
	 */
	void registerManagedResource(Object managedResource, ObjectName objectName) throws MBeanExportException;

	/**
	 * Remove the specified MBean from the underlying MBeanServer registry.
	 * @param objectName the {@link ObjectName} of the resource to remove
	 */
	/**
	 *从基础MBeanServer注册表中删除指定的MBean。
	 *@param objectName要删除的资源的｛@link objectName｝
	 */
	void unregisterManagedResource(ObjectName objectName);

}
